<div>
    <form class="form-horizontal bv-form"  role="form"  id="updateForm">
        <fieldset>
            <legend>基本信息</legend>
            <div class="form-group">
                <label class="col-sm-3 control-label">手机号码</label>
                <div class="col-sm-5">
                    <input type="text"  class="form-control number" name="user_phone">

                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">用户昵称</label>
                <div class="col-sm-5">
                    <input type="text"  class="form-control" name="user_username">

                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">真实姓名</label>
                <div class="col-sm-5">
                    <input type="text"  class="form-control" name="real_name">

                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">职务</label>
                <div class="col-sm-5">
                    <input type="text"  class="form-control" name="user_post">

                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">身份证号码</label>
                <div class="col-sm-5">
                    <input type="text"  class="form-control" name="card_id">

                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">上传身份证正面</label>
                <div class="col-sm-5">
                    <a href="javascript:;" class="file file1">选择文件
                        <input type="file" name="fileZ" id="file1" onchange="aaaa(this);">
                    </a>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">预览图</label>
                <div class="col-sm-3 file1_1" id="androimg" style="float:left">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">上传身份证反面</label>
                <div class="col-sm-5">
                    <a href="javascript:;" class="file file2" id="">选择文件
                        <input type="file" name="fileF" id="file2" onchange="bbbb(this);">
                    </a>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">预览图</label>
                <div class="col-sm-3 file2_2" id="androimg1" style="float:left">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">出生日期</label>
                <div class="col-sm-5">
                    <input class="form-control" type="text" placeholder="出生年月日" name="start" id="start" onclick="WdatePicker({lang:'zh-cn',dateFmt:'yyyy-MM-dd'})"/>

                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">兴趣爱好</label>
                <div class="col-sm-5">
                    <input type="text"  class="form-control" name="user_hobby">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">省</label>
                <div class="col-sm-5">
                    <select class="SearchForm form-control province" name="province"style="width:200px;height:32px;">
                        {volist name="province" id="vv"}
                        <option value="{$vv.district_id}">{$vv.district}</option>
                        {/volist}
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">市</label>
                <div class="col-sm-5">
                    <select class="SearchForm form-control city"  name="city"style="width:200px;height:32px;">
                        <option>不限</option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">区</label>
                <div class="col-sm-5">
                    <select class="SearchForm form-control area"  name="area"style="width:200px;height:32px;">
                        <option>不限</option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">从事行业</label>
                <div class="col-sm-5">
                    <select class="SearchForm form-control "  name="user_job"style="width:200px;height:32px;">
                        {volist name="user_job" id="vo"}
                        <option value="{$vo.region_id}">{$vo['region_name']}</option>
                        {/volist}
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">简介</label>
                <div class="col-sm-5">
                    <textarea class="form-control" rows="5" name="user_signature"></textarea>
                </div>
            </div>
        </fieldset>
    </form>

</div>
<!-- 编辑器源码文件 -->
<script>
    $(".number").on("keyup",function(){
        this.value = this.value.replace(/[^0-9]/g,'');
        if(this.value<1){this.value='';}
    });
</script>
<script type="text/javascript">

    function aaaa(file) {
        var prevDiv = document.getElementById('androimg');
        if (file.files && file.files[0])
        {
            var reader = new FileReader();
            reader.onload = function(evt){
                prevDiv.innerHTML = '<img src="' + evt.target.result + '" height="150" width="150"/>';
            }
            reader.readAsDataURL(file.files[0]);
        }
        else
        {
            prevDiv.innerHTML = '<div class="img" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src=\'' + file.value + '\'"></div>';
        }
    }
    function bbbb(file) {
        var prevDiv = document.getElementById('androimg1');
        if (file.files && file.files[0])
        {
            var reader = new FileReader();
            reader.onload = function(evt){
                prevDiv.innerHTML = '<img src="' + evt.target.result + '" height="150" width="150"/>';
            }
            reader.readAsDataURL(file.files[0]);
        }
        else
        {
            prevDiv.innerHTML = '<div class="img" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src=\'' + file.value + '\'"></div>';
        }
    }

    $(".template").on('change',function () {
        var template_val = $(this).val();
        if(template_val==1){
            $(".file1").show();
            $(".file2,.file3").hide();
        }else if(template_val==3){
            $(".file2,.file1,.file3").show();
        }
    })
    $(".province").bind("change",function () {
        var city = $(".province").val();
        $(".area").html("");
        var html = " <option value=''>不限</option>";
        $(".area").append(html);

        getCity(city);
    })
    $(".city").on("change",function () {
        var city = $(".city").val();
        getArea(city);
    })
    function getCity(city){
        $.ajax({
            url: 'super/User/city',
            data: {city: city},
            type: 'POST',
            dataType: 'json',//返回的数据类型
            success: function (data) {
                var cityArray =  data.cityArray;
                $(".city").html("");
                var html = " <option value=''>不限</option>";
                $.each(cityArray, function (i, item) {
                    html += "<option value='"+item.district_id+"'>" + item.district + "</option>";
                });
                $(".city").append(html);
            }
        })
    }

    function getArea(area){
        $.ajax({
            url: 'super/User/area',
            data: {area: area},
            type: 'POST',
            dataType: 'json',//返回的数据类型
            success: function (data) {
                var cityArray =  data.cityArray;
                $(".area").html("");
                var html = " <option value=''>不限</option>";
                $.each(cityArray, function (i, item) {
                    html += "<option value='"+item.district_id+"'>" + item.district + "</option>";
                });
                $(".area").append(html);
            }
        })
    }


</script>




